﻿@model ExportProfileModel
@using SmartStore.Core.Domain.DataExchange;
@using SmartStore.Admin.Models.DataExchange;

<table class="adminContent">
	<tr id="ProjectionStoreContainer">
		<td class="adminTitle">
			@Html.SmartLabelFor(x => x.Projection.StoreId)
		</td>
		<td class="adminData">
			@Html.DropDownListFor(x => x.Projection.StoreId, Model.Projection.AvailableStores, Model.UnspecifiedString)
			@Html.ValidationMessageFor(x => x.Projection.StoreId)
		</td>
	</tr>
	<tr>
		<td class="adminTitle">
			@Html.SmartLabelFor(x => x.Projection.LanguageId)
		</td>
		<td class="adminData">
			@Html.DropDownListFor(x => x.Projection.LanguageId, Model.Projection.AvailableLanguages, Model.UnspecifiedString)
			@Html.ValidationMessageFor(x => x.Projection.LanguageId)
		</td>
	</tr>
	<tr>
		<td class="adminTitle">
			@Html.SmartLabelFor(x => x.Projection.CurrencyId)
		</td>
		<td class="adminData">
			@Html.DropDownListFor(x => x.Projection.CurrencyId, Model.Projection.AvailableCurrencies, Model.UnspecifiedString)
			@Html.ValidationMessageFor(x => x.Projection.CurrencyId)
		</td>
	</tr>
	<tr>
		<td class="adminTitle">
			@Html.SmartLabelFor(x => x.Projection.CustomerId)
		</td>
		<td class="adminData">
			@Html.TextBoxFor(x => x.Projection.CustomerId, new { autocomplete = "off", @class = "text-box single-line" })
			@Html.ValidationMessageFor(x => x.Projection.CustomerId)
		</td>
	</tr>

	@if (Model.Provider.EntityType == ExportEntityType.Product)
	{
		if (Model.Provider.Feature.HasFlag(ExportFeatures.CanProjectAttributeCombinations))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.AttributeCombinationAsProduct)
				</td>
				<td class="adminData">
					@Html.CheckBoxFor(x => x.Projection.AttributeCombinationAsProduct, new { data_toggler_for = "#AttributeCombinationAddValuesToNameContainer" })
					@Html.ValidationMessageFor(x => x.Projection.AttributeCombinationAsProduct)
				</td>
			</tr>
			<tr id="AttributeCombinationAddValuesToNameContainer">
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.AttributeCombinationValueMergingId)
				</td>
				<td class="adminData">
					@Html.DropDownListFor(x => x.Projection.AttributeCombinationValueMergingId, Model.Projection.AvailableAttributeCombinationValueMerging)
					@Html.ValidationMessageFor(x => x.Projection.AttributeCombinationValueMergingId)

					<span class="d-block text-muted mt-1">
						@T("Admin.DataExchange.Export.NotPreviewCompatible")
					</span>
				</td>
			</tr>
		}

		if (Model.Provider.Feature.HasFlag(ExportFeatures.CanOmitGroupedProducts))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.NoGroupedProducts)
				</td>
				<td class="adminData">
					@Html.CheckBoxFor(x => x.Projection.NoGroupedProducts, new { data_toggler_for = "#OnlyIndividuallyVisibleAssociatedContainer" })
					@Html.ValidationMessageFor(x => x.Projection.NoGroupedProducts)
				</td>
			</tr>
			<tr id="OnlyIndividuallyVisibleAssociatedContainer">
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.OnlyIndividuallyVisibleAssociated)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.OnlyIndividuallyVisibleAssociated)
					@Html.ValidationMessageFor(x => x.Projection.OnlyIndividuallyVisibleAssociated)

					<span class="ml-3 text-muted" style="vertical-align:super">
						@T("Admin.DataExchange.Export.NotPreviewCompatible")
					</span>
				</td>
			</tr>
		}

		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(x => x.Projection.PriceType)
			</td>
			<td class="adminData">
				@Html.DropDownListFor(x => x.Projection.PriceType, Model.Projection.AvailablePriceTypes, T("Admin.Catalog.Products.Fields.Price"))
				@Html.ValidationMessageFor(x => x.Projection.PriceType)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(x => x.Projection.ConvertNetToGrossPrices)
			</td>
			<td class="adminData">
				@Html.EditorFor(x => x.Projection.ConvertNetToGrossPrices)
				@Html.ValidationMessageFor(x => x.Projection.ConvertNetToGrossPrices)
			</td>
		</tr>

		if (Model.Provider.Feature.HasFlag(ExportFeatures.OffersShippingTimeFallback))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.ShippingTime)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.ShippingTime)
					@Html.ValidationMessageFor(x => x.Projection.ShippingTime)
				</td>
			</tr>
		}

		if (Model.Provider.Feature.HasFlag(ExportFeatures.OffersShippingCostsFallback))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.ShippingCosts)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.ShippingCosts)
					@Html.ValidationMessageFor(x => x.Projection.ShippingCosts)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.FreeShippingThreshold)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.FreeShippingThreshold)
					@Html.ValidationMessageFor(x => x.Projection.FreeShippingThreshold)
				</td>
			</tr>
		}

		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(x => x.Projection.NumberOfPictures)
			</td>
			<td class="adminData">
				@Html.EditorFor(x => x.Projection.NumberOfPictures)
				@Html.ValidationMessageFor(x => x.Projection.NumberOfPictures)
			</td>
		</tr>

		if (Model.Provider.Feature.HasFlag(ExportFeatures.CanIncludeMainPicture))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.PictureSize)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.PictureSize)
					@Html.ValidationMessageFor(x => x.Projection.PictureSize)
				</td>
			</tr>
		}

		if (Model.Provider.Feature.HasFlag(ExportFeatures.OffersBrandFallback))
		{
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.Brand)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.Brand)
					@Html.ValidationMessageFor(x => x.Projection.Brand)
				</td>
			</tr>
		}

		if (Model.Provider.Feature.HasFlag(ExportFeatures.CanProjectDescription))
		{
			<tr>
				<td colspan="2">
					<div class="admin-config-group">
						<div class="title">@T("Common.DetailDescription")</div>
					</div>
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.DescriptionMergingId)
				</td>
				<td class="adminData">
					@Html.DropDownListFor(x => x.Projection.DescriptionMergingId, Model.Projection.AvailableDescriptionMergings)
					@Html.ValidationMessageFor(x => x.Projection.DescriptionMergingId)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.AppendDescriptionText)
				</td>
				<td class="adminData">
					@Html.ListBoxFor(x => x.Projection.AppendDescriptionText, Model.Projection.AvailableAppendDescriptionTexts, new { multiple = "multiple", data_tags = "true" })
					@Html.ValidationMessageFor(x => x.Projection.AppendDescriptionText)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.RemoveCriticalCharacters)
				</td>
				<td class="adminData">
					@Html.CheckBoxFor(x => x.Projection.RemoveCriticalCharacters, new { data_toggler_for = "#pnlCriticalCharacters" })
					@Html.ValidationMessageFor(x => x.Projection.RemoveCriticalCharacters)
				</td>
			</tr>
			<tr id="pnlCriticalCharacters">
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.CriticalCharacters)
				</td>
				<td class="adminData">
					@Html.ListBoxFor(x => x.Projection.CriticalCharacters, Model.Projection.AvailableCriticalCharacters, new { multiple = "multiple", data_tags = "true" })
					@Html.ValidationMessageFor(x => x.Projection.CriticalCharacters)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(x => x.Projection.DescriptionToPlainText)
				</td>
				<td class="adminData">
					@Html.EditorFor(x => x.Projection.DescriptionToPlainText)
					@Html.ValidationMessageFor(x => x.Projection.DescriptionToPlainText)
				</td>
			</tr>
		}
	}
	else if (Model.Provider.EntityType == ExportEntityType.Order)
	{
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(x => x.Projection.OrderStatusChangeId)
			</td>
			<td class="adminData">
				@Html.DropDownListFor(x => x.Projection.OrderStatusChangeId, Model.Projection.AvailableOrderStatusChange)
				@Html.ValidationMessageFor(x => x.Projection.OrderStatusChangeId)
			</td>
		</tr>
	}
	else if (Model.Provider.EntityType == ExportEntityType.ShoppingCartItem)
	{
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(x => x.Projection.NoBundleProducts)
			</td>
			<td class="adminData">
				@Html.EditorFor(x => x.Projection.NoBundleProducts)
				@Html.ValidationMessageFor(x => x.Projection.NoBundleProducts)
			</td>
		</tr>
	}
</table>